package cn.org.mrliu.code.generator.bean;

import java.io.Serializable;
import java.util.List;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

public class Table implements Serializable{
	private static final long serialVersionUID = 3080822528248913664L;
	private String pkName;									//主键名称
	private String pkPlaceholderName;						//主键占位名称
	private String pkPlaceholderSimpleName;					//主键占位简单名称
	private String name;									//表名
	private String modelName;								//模型名称
	private String comment;									//注释
	private List<Column> columns;							//所有列
	private List<Column> baseColumns;						//基本的列,不包含ID
	private Boolean hasDateType = false;					//是否有日期类型
	public Table() {
		super();
	}
	public Table(String name, String comment) {
		this.name = name;
		this.comment = comment;
		String str = name.substring(name.indexOf("_")+1);
		this.modelName = str.substring(0, 1).toUpperCase()+str.substring(1);
	}
	public String getPkName() {
		return pkName;
	}
	public void setPkName(String pkName) {
		this.pkName = pkName;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getModelName() {
		return modelName;
	}
	public void setModelName(String modelName) {
		this.modelName = modelName;
	}
	public String getComment() {
		return comment;
	}
	public void setComment(String comment) {
		this.comment = comment;
	}
	public List<Column> getColumns() {
		return columns;
	}
	public void setColumns(List<Column> columns) {
		this.columns = columns;
	}
	public List<Column> getBaseColumns() {
		return baseColumns;
	}
	public void setBaseColumns(List<Column> baseColumns) {
		this.baseColumns = baseColumns;
	}
	public Boolean getHasDateType() {
		return hasDateType;
	}
	public void setHasDateType(Boolean hasDateType) {
		this.hasDateType = hasDateType;
	}
	public String getPkPlaceholderName() {
		return pkPlaceholderName;
	}
	public void setPkPlaceholderName(String pkPlaceholderName) {
		this.pkPlaceholderName = pkPlaceholderName;
	}
	public String getPkPlaceholderSimpleName() {
		return pkPlaceholderSimpleName;
	}
	public void setPkPlaceholderSimpleName(String pkPlaceholderSimpleName) {
		this.pkPlaceholderSimpleName = pkPlaceholderSimpleName;
	}
	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this,ToStringStyle.MULTI_LINE_STYLE);
	}
	
}
